<?php require APP_ROOT.'public/head.php';
if(session('member')=='')
{
    goto_url('index.php?m=member&a=login');
}
?>
    <link href="css/chunk-1188cc8c.25224e5c.css"   rel="stylesheet" type="text/css" >
    <link href="css/chunk-2d1cd1e6.779f2ebd.css"   rel="stylesheet" type="text/css" >
    <div class="page">
        <?php require APP_ROOT.'public/top.php';?>
        <!---->
    <div class="home_kf">
        <p>微信客服
            <img src="images/kf.jpg" alt="" class="home_kf_code">
        </p>
    </div>
    <style>
        .home_kf_code{display: none;}
        .home_kf:hover .home_kf_code{display: block;}
    </style>




        <div class="page_body body_order">
            <div class="order_form page_body_content">
                <div class="order_form_left">
                    <ul role="menubar" class="order_form_left_menu el-menu">
                        <li role="menuitem" tabindex="-1" class="el-menu-item is-active" style="padding-left: 20px;"><i class="el-icon-s-order"></i><span>订单管理</span></li>
                        <li role="menuitem" tabindex="-1" class="el-menu-item" style="padding-left: 20px;"><i class="el-icon-tickets"></i><span>批量发货教程</span></li>
                    </ul>
                </div>




                <div class="order_form_right">
                    <div class="order_admin">

<?php
$gt_date=pg('gt_date');
$lt_date=pg('lt_date');
$zuixe=strtotime($gt_date);
$zuide=strtotime($lt_date);
$state=pg('state');
$order_number=pg('order_number');
$picihao=pg('picihao');


$perpage=10;$offset=($p-1)*$perpage;
if($state){
    $where['state']=$state;
}
if($order_number){
    $where['order_number']=$order_number;
}
if($picihao){
    $where['picihao']=$picihao;
}
if($zuixe!='' && $zuide!=''){
    $where['date']  = array('between',array($zuixe,$zuide));
}elseif($zuixe!='' && $zuide==''){
    $where['date']  = array('gt',$zuixe);
}elseif($zuixe=='' && $zuide!=''){
    $where['date']  = array('lt',$zuide);
}

$where['member_id']=$member['member_id'];
$order = M('order')->where($where)->order('date desc')->limit($offset,$perpage)->select();
$total_num=M('order')->where($where)->count(); ?>
                        <div class="order_condition">
                            <form action="?m=order&a=index&shu=1" method="post" enctype="multipart/form-data" id="huiosa">
                            <div class="order_condition_item">
                                <div class="el-date-editor order_condition_item_start_date el-input el-input--small el-input--prefix el-input--suffix el-date-editor--date">
                                    <!---->
                                    <input type="text" autocomplete="off" name="gt_date" style="width: 150px;height: 32px;line-height: 32px;border:1px solid #c0c4cc;"  class="laydate-input" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" placeholder="开始日期" class="el-input__inner" value="<?php echo $gt_date; ?>"/>

                                </div> 至
                                <div class="el-date-editor order_condition_item_end_date el-input el-input--small el-input--prefix el-input--suffix el-date-editor--date">
                                    <!---->
                                    <input type="text" autocomplete="off" name="drias"  style="height: 32px;line-height: 32px;border:1px solid #c0c4cc;"   class="laydate-input" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" placeholder="结束日期" class="el-input__inner"  value="<?php echo $lt_date; ?>"/>

                                </div>
                            </div>
                            <div class="order_condition_item">
                                <div class="el-select order_condition_item_select el-select--small">
                                    <!---->
                                    <div class="el-input el-input--small el-input--suffix">
                                        <select name="state" style="width: 150px;height: 34px;line-height: 34px;border:1px solid #c0c4cc;">
                                            <option value="">全部</option>
                                            <option value="383" <?php if($state==383)echo ' selected="selected"';?>>已发货</option>
                                            <option value="382"<?php if($state==382)echo ' selected="selected"';?>>未发货</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="order_condition_item">
                                <div class="order_condition_item_search el-input el-input--small el-input--suffix">
                                    <input type="text" name="order_number" autocomplete="off" placeholder="订单编号" class="el-input__inner" value="<?php echo $order_number; ?>"/>
                                </div>
                            </div>
                            <div class="order_condition_item">
                                <div class="order_condition_item_search el-input el-input--small el-input--suffix">
                                    <input type="text" name="picihao" autocomplete="off" placeholder="订单批次号" class="el-input__inner" value="<?php echo $picihao; ?>" />
                                </div>
                            </div>
                            <div class="order_condition_item">
                                <button type="button" class="el-button el-button--default el-button--small shaixuans" slot="append">
                                    <i class="el-icon-search"></i><span>查询</span></button>
                            </div>
                            </form>

                            <div class="order_condition_item">
                                <a target="__blank" href="javascript:;"></i> 导出 </a>
                            </div>
                        </div>
<script>
    $('.shaixuans').click(function(){
        $('#huiosa').submit();
    });
</script>


                        <div class="order_admin_body">


                            <div class=" el-table--fit el-table--scrollable-x" style="width: 100%;">


                                <!---->
                                <div class="" style="overflow-y: hidden;">
                                    <div class="">
                                        <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 1870px;">
                                            <thead class="">
                                            <tr class="bianjdsa">
                                                <th colspan="1" rowspan="1" class="el-table_1_column_1 jindsua">
                                                    <div class="cell">
                                                        交易时间
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_2 jindsua">
                                                    <div class="cell">
                                                        电商平台
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_3 jindsua">
                                                    <div class="cell">
                                                        快递平台
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_4 jindsua">
                                                    <div class="cell">
                                                        快递单号
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_5 jindsua">
                                                    <div class="cell">
                                                        订单ID
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_6 jindsua">
                                                    <div class="cell">
                                                        商品名称
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_7 jindsua">
                                                    <div class="cell">
                                                        商品价格
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_8 jindsua">
                                                    <div class="cell">
                                                        订单批次号
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_9 jindsua">
                                                    <div class="cell">
                                                        收件人
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_10 jindsua">
                                                    <div class="cell">
                                                        收件人手机号
                                                    </div></th>
                                                <th colspan="1" rowspan="1" class="el-table_1_column_11 jindsua">
                                                    <div class="cell">
                                                        详细地址
                                                    </div></th>
                                            </tr>

<?php if($order){ ?>
	<?php	foreach($order as $k=>$v){
	    $order_goods=M('order_goods')->where(array('order_number'=>$v['order_number']))->find();
	    ?>

                                            <tr class="bianjdsa">
                                                <td colspan="1" rowspan="1" class="el-table_1_column_1  jindsua2">
                                                    <div class="cell">
                                                        <?php echo date('Y-m-d',$v['date']); ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_2 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $site['company_name'];?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_3 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['kuadit']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_4 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['kuaididh']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_5 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['order_number']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_6 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $order_goods['goods_name']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_7 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['price']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_8 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['picihao']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_9 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['consignee']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_10 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['phone']; ?>
                                                    </div></td>
                                                <td colspan="1" rowspan="1" class="el-table_1_column_11 jindsua2">
                                                    <div class="cell">
                                                        <?php echo $v['address']; ?>
                                                    </div></td>
                                            </tr>
    <?php } ?>
<?php }else{ ?>
                                            <tr class="bianjdsa">
                                                <td colspan="11" rowspan="1" class="el-table_1_column_1  jindsua2">
                                                    <div class="cell">
                                                        暂无数据
                                                    </div></td>

                                            </tr>
<?php } ?>

                                            </thead>
                                        </table>
                                    </div>

                                    <!---->
                                </div>
                                <!---->
                                <!---->
                                <div class="el-table__column-resize-proxy" style="/* display: none; */"></div>
                            </div>


        <div class="table_pagination el-pagination">
            <?php require APP_ROOT.'public/page.php';?>

        </div>
        <div class="recharge" style="display: none;">
            <div class="el-dialog__wrapper" style="display: none;">
                <div role="dialog" aria-modal="true" aria-label="充值" class="el-dialog" style="margin-top: 15vh; width: 460px;">
                    <div class="el-dialog__header">
                        <span class="el-dialog__title">充值</span>
                        <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close"></i></button>
                    </div>
                    <!---->
                    <!---->
                </div>
            </div>
        </div>
    </div>
    <style>
        .bianjdsa th{border-bottom:1px solid #ebeef5;border-top:1px solid #ebeef5; }
        .bianjdsa th:first-child{border-left:1px solid #ebeef5;}
        .bianjdsa th:last-child{border-right:1px solid #ebeef5;}
        .bianjdsa td{border-bottom:1px solid #ebeef5;}
        .bianjdsa td:first-child{border-left:1px solid #ebeef5;}
        .bianjdsa td:last-child{border-right:1px solid #ebeef5;}
        .jindsua{padding: 12px 0;color: #909399;}
        .jindsua2{padding: 12px 5px;color: #909399;text-align: center;}
    </style>
<?php require APP_ROOT.'public/bottom.php';?>